<?php 

/**
 * Joomla! 1.5 component arts_curriculum
 * @package    arts_curriculum
 * @subpackage
 * @author     Chris Borkowski {@link http://www.guggenheim.org}
 * @author     Created on 31-August-2009
 * @author    Modified on 16-July-2010
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' ); 

function searchMessage(){
$search =& JFactory::getURI();
$u =& JFactory::getURI();
$message = $search->getVar('search', 'There are no items to be displayed', 'post','string');
$message = str_replace("-", " ", $message);

if ($message =='exhibitions') {
$message = "Exhibiitons";
} 
return $message;
}

?>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>

<div id="ac_sort_page_box">

     <?php if (searchMessage() == 'Note') :?>
    	<h4>Note to Teachers</h4>
    	<div id="ac_note"><?php echo $this->note[0]->main_body ;?></div>
   
   <?php else :?>
  <div id="ac_sort_page_title">
	<span id="ac_sort_message"><h4><?php  echo searchMessage(); ?> </h4></span>
   </div>
   <?php endif ;?>
   
   <?php if (searchMessage() == "Artists") :?>
	
		<div id="artist_sort">
		<?php Arts_curriculumFrontHelper::cleansort($this->items); ?>
		</div>      
    
   <?php elseif (searchMessage() == 'Exhibitions') :?>
    
    	<?php foreach ($this->items as $item) : ?>
     	<div id="ac_sort_lesson_box_ex">
     	<div id="ac_sort_lesson_box_thumbs_ex"><?php echo $item->catThumbnail ;?></div>
      	<div id ="ac_sort_cat_link_ex"><?php echo str_replace("ac_sort_cat_link", "ac_sort_cat_link_alt ", $item->catlink); ?> 
      	<div id ="ac_sort_blurb_ex"><?php echo $item->vBLURB;?></div></div>
     	 </div>
     
     <?php endforeach; ?>

     <?php elseif (searchMessage() != '' && searchMessage() != 'Note') :?>
     
     <?php foreach ($this->items as $item): ?>
    
		<div id="ac_sort_lesson_box">
			<div id ="ac_sort_cat_link"><?php echo $item->catlink; ?></div>
			<div id ="ac_sort_article_link"><?php echo $item->link; ?></div>
			<div id ="ac_sort_lesson_areas_box">
			<?php Arts_curriculumFrontHelper::subjectlinks(& $item->subject); ?>
			</div>
		</div>
    
    <?php endforeach; ?>
 

<?php endif ;?>


</div>
  </tr>
</table>
<from>
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="sortby" value="" />
</form>
